home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nebula 1
/
Nebula One.iso
/
Mail
/
MailEnclosure
/
Source.v0.15
/
DocumentController.m
< prev
next >
Wrap
Text File
|
1995-06-12
|
827b
|
52 lines
#import "DocumentController.h"
#import "StringStorage.h"
@implementation DocumentController
- init
{
[super init];
docType = [[StringStorage alloc] init];
panel = nil;
return self;
}
-free
{
[docType free];
return [super free];
}
- setDocType: (const char *) str
{
[docType setStringValue: str];
return self;
}
- makeKeyAndOrderFront:sender
{
if(!panel)
{
char buf[MAXPATHLEN + 1];
if(!*[docType stringValue])
{
NXLogError("Opening a document with unknown nib name.");
return nil;
}
[[NXBundle bundleForClass:[self class]]
getPath: buf forResource: [docType stringValue] ofType:"nib"];
[NXApp loadNibFile:buf owner:self withNames:NO fromZone:[self zone]];
}
[panel makeKeyAndOrderFront: sender];
return self;
}
@end